﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kiiro.Common.Entities
{
    public class Midori
    {
        private Setup setup;
        private List<ActivityHistory> activityHistories = new List<ActivityHistory> ( );
        private List<Comment> comments = new List<Comment> ( );
        private List<CustomItem> customItems = new List<CustomItem> ( );
        private List<Discussion> discussions = new List<Discussion> ( );
        private List<Document> documents = new List<Document> ( );
        private List<Project> projects = new List<Project> ( );
        private List<TeamMember> teamMembers = new List<TeamMember> ( );
        private List<User> users = new List<User> ( );
        private List<Work> work = new List<Work> ( );

        public Setup Setup
        {
            get { return setup; }
            set { setup = value; }
        }

        public List<ActivityHistory> ActivityHistories
        {
            get { return activityHistories; }
            set { activityHistories = value; }
        }

        public List<Comment> Comments
        {
            get { return comments; }
            set { comments = value; }
        }

        public List<CustomItem> CustomItems
        {
            get { return customItems; }
            set { customItems = value; }
        }

        public List<Discussion> Discussions
        {
            get { return discussions; }
            set { discussions = value; }
        }

        public List<Document> Documents
        {
            get { return documents; }
            set { documents = value; }
        }

        public List<Project> Projects
        {
            get { return projects; }
            set { projects = value; }
        }

        public List<TeamMember> TeamMembers
        {
            get { return teamMembers; }
            set { teamMembers = value; }
        }

        public List<User> Users
        {
            get { return users; }
            set { users = value; }
        }

        public List<Work> Work
        {
            get { return work; }
            set { work = value; }
        }

        public List<BaseEntity> AllEntities ( )
        {
            List<BaseEntity> entities = new List<BaseEntity> ( );

            if ( Setup != null )
                entities.Add ( ( BaseEntity ) setup );

            foreach ( ActivityHistory entity in ActivityHistories )
                entities.Add ( ( BaseEntity ) entity );

            foreach ( Comment entity in Comments )
                entities.Add ( ( BaseEntity ) entity );

            foreach ( CustomItem entity in CustomItems )
                entities.Add ( ( BaseEntity ) entity );

            foreach ( Discussion entity in Discussions )
                entities.Add ( ( BaseEntity ) entity );

            foreach ( Document entity in Documents )
                entities.Add ( ( BaseEntity ) entity );

            foreach ( Project entity in Projects )
                entities.Add ( ( BaseEntity ) entity );

            foreach ( TeamMember entity in TeamMembers )
                entities.Add ( ( BaseEntity ) entity );

            foreach ( User entity in Users )
                entities.Add ( ( BaseEntity ) entity );

            foreach ( Work entity in Work )
                entities.Add ( ( BaseEntity ) entity );

            return entities;
        }
    }
}

/*************************************************************************
 * 
 * $Log: /Internal Projects/Kiiro/Kiiro.Common/Entities/Midori.cs $
 * 
 * 4     17/08/09 10:38a Camerons
 * Added check-in comments section
 * 
 ************************************************************************/